#include <iostream>
using namespace std;


class CPoint
{
public:
    CPoint(int x_,int y_):x(x_),y(y_){}

    // 重载运算符　<< 
    friend ostream & operator <<(ostream & os,const CPoint & p){
        return os << "x = "<<p.x  << " y = "<< p.y << endl;
    }

    int x,y;
};

int main()
{
    CPoint point(1,2);
    cout << point;
}